package com.lu.adog.demo.common;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;

import com.lu.adog.R;
import com.lu.adog.base.BaseActivity;
import com.lu.adog.demo.base.App;
import com.lu.adog.demo.base.BaseConfig;
import com.lu.adog.util.AppUtil;
import com.lu.adog.util.Logg;

/**
 * @author Yue
 * @date 2017/11/16 17:06
 */

public class CommonActivity extends BaseActivity implements ILinkCommon.View {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        int title = getIntent().getIntExtra(BaseConfig.KEY_TITLE, 0);
        setAcionBarTitle(title);
    }

    @Override
    public void setAcionBarTitle(int title) {
        ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            if (title != 0) {
                actionBar.setTitle(getString(title));

            } else {
                actionBar.setTitle(AppUtil.getAppName(this));
            }
        }
    }
}
